<div class="row">
 <small>
 <div class="span3 bs-docs-sidebar ">
 	<*include file="<*$controller*>/location.tpl"*>
  </div>
 
  <div class="span9">
   <div class="clearfix txtleft search span9" style="background-color:#f8f8f8; padding:10px; margin:10px 0px;"> 
      <form action="/<*$controller*>/sendnew" method="get"   name="form1" class="form-horizontal">       
		  <select id="jigou" name="groups"  ></select>
          <select id="school" name="school"   ></select> 
         <input type="submit" class="btn btn-success"  value="查询"  >
         <input type="button" class="btn btn-success" value="清空查询" onclick="window.location='/<*$controller*>/sendnew'" >
      </form>
	</div>	    
    <*if $school|@count neq 0*>  
       <table class="table table-condensed table-bordered table-hover span9"> 
        <tr class="success">   
           <td><strong>所属机构</strong></td>
           <td><strong>所属校园</strong></td>
           <td><strong>操作</strong></td>
        </tr>
      		<*foreach from=$school item=a key =key name=foo*> 
            <tr>
               <td class="span1"><*$a.groupname*></td>
               <td class="span1"><*$a.schoolname*></td> 
               <td class="span1">
               <!--<a style="cursor:pointer" herf="javascript:sendit('<*$a.schoolid*>')" > 发新卡</a>-->
               <a style="cursor:pointer" title="详细" onClick="sendit('<*$a.schoolid*>')" ><i class="icon-list-alt"></i></a>
               </td> 

            </tr>
            <*/foreach*>
        <tr>
           <td colspan="3"> 
              <*$page*> 
          </td>
         </tr>  
      </table>
      <*else*>  
             
        <*/if*>  
    </div>
    </small> 
     
<!-- <script type="text/javascript" src="/js/prototype.js"></script>  -->
<script type="text/javascript"> 
  
  
 
       function   ajax_post(){ 
	    var groupsid="<*$groups*>"; 
        $.post("/<*$controller*>/groups/",{"jigouid":groupsid},function(data,statusText){ 
			 $("#jigou").append(data); 
        });  
	 } 
	  
	  $("#jigou").change(function(){
           // $("#city option:gt(0)").remove();  //清空所有城市的信息
            //$("#county option:gt(0)").remove();  //清空所有县级的信息
            var id = this.value;
			var schoolid="<*$schoolid*>";  
			  
            $.post("/<*$controller*>/schoollist/",{"id":id,"sid":schoolid},function(data,statusText){
                 $("#school").html('');
                 $("#school").append(data);
            
            });
        });
		
		$("#school").change(function(){
           // $("#city option:gt(0)").remove();  //清空所有城市的信息
            //$("#county option:gt(0)").remove();  //清空所有县级的信息
            var sid = this.value; 
            $.post("/<*$controller*>/classlist/",{"id":sid},function(data,statusText){
				 
                 $("#class1").html('');
                 $("#class1").append(data);
            
            });
        });
		
	
	 window.onload=function(){
	    ajax_post(); 
	 if( '<*$groups*>'+0 != 0 ){ 
	        
			var id = '<*$groups*>'; 
			var sid = '<*$schoolid*>';  
			 
			$.post("/<*$controller*>/schoollist/",{"id":id,"sid":sid},function(data,statusText){
				 $("#school").html('');
				 $("#school").append(data); 
				});
	    } 
          
	 if('<*$schoolid*>'+0 != 0){   
		   var id = '<*$schoolid*>'; 
		   var cid='<*$classid*>';
			$.post("/<*$controller*>/classlist/",{"id":id,"cid":cid},function(data,statusText){ 
				 $("#class1").html('');
				 $("#class1").append(data); 
				}); 
		   
	 }/* */

 } 
	function sendit(sid){
   window.location='/<*$controller*>/senditexcle/schoolid/'+sid;   
}  		 
		
	  

</script>
  
 </div> 